<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<!-- [Head] start -->

<head>
    <script src="/myhouse/static/ueditor/ueditor.config.js" type="text/javascript"></script>
    <script src="/myhouse/static/ueditor/ueditor.all.js" type="text/javascript"></script>
    <script src="/myhouse/static/mediator/js/jquery-3.2.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/myhouse/static/mediator/js/jquery-3.2.1.min.js"></script>
    <title>Typography | Berry Bootstrap 5 Admin Template</title>
    <!-- [Meta] -->
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta
            name="description"
            content="Berry is made using Bootstrap 5 design framework. Download the free admin template & use it for your project."
    />
    <meta name="keywords" content="Berry, Dashboard UI Kit, Bootstrap 5, Admin Template, Admin Dashboard, CRM, CMS, Bootstrap Admin Template" />

    <!-- [Favicon] icon -->
    <link rel="icon" href="/myhouse/static/mediator/images/favicon.svg" type="image/x-icon" />
    <!-- [Google Font] Family -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" id="main-font-link" />
    <!-- [Tabler Icons] https://tablericons.com -->
    <link rel="stylesheet" href="/myhouse/static/mediator/fonts/tabler-icons.min.css" />
    <!-- [Material Icons] https://fonts.google.com/icons -->
    <link rel="stylesheet" href="/myhouse/static/mediator/fonts/material.css" />
    <!-- [Template CSS Files] -->
    <link rel="stylesheet" href="/myhouse/static/mediator/css/style.css" id="main-style-link" />
    <link rel="stylesheet" href="/myhouse/static/mediator/css/style-preset.css" id="preset-style-link" />

</head>
<!-- [Head] end -->
<!-- [Body] Start -->

<body>
<!-- [ Pre-loader ] start -->
<div class="loader-bg">
    <div class="loader-track">
        <div class="loader-fill"></div>
    </div>
</div>
<!-- [ Pre-loader ] End -->
<!-- [ Header Topbar ] start -->
<jsp:include page="/inc/mediatorTop.jsp"></jsp:include>
<!-- [ Header ] end -->
<!-- [ Sidebar Menu ] start -->
<nav class="pc-sidebar">
    <div class="navbar-wrapper">
        <div class="m-header">
            <a href="index.jsp" class="b-brand">
                <!-- ========   Change your logo from here   ============ -->
                <img src="/myhouse/static/mediator/images/logo-dark.svg" alt="" class="logo logo-lg" />
            </a>
        </div>
        <jsp:include page="/inc/mediatorLeft.jsp"></jsp:include>
    </div>
</nav>
<style type="text/css">
    /*#title{*/
    /*    width: 900px;*/
    /*    height: 400px;*/
    /*}*/
    table {
        width: 800px;
        border-collapse: collapse;
        margin: 0 auto;
    }
    td {
        border: 1px solid #ccc;
        padding: 8px;
        text-align: center;
    }
    th {
        background-color: #f2f2f2;
        border: 1px solid #ccc;
        padding: 8px;
        text-align: center;
    }
    tr:nth-child(even) {
        background-color: #f9f9f9;
    }
    /*所有页码的div*/
    #mydiv{
        /*position: relative;*/
        /*left: 300px;*/
        /*top: 30px;*/
        display: flex;
        justify-content: center;
        margin-top: 30px;
    }
    /*分页页码div*/
    .pageNumDiv{
        width: 40px;
        height: 40px;
        border-radius: 20px;
        background-color: #24BCFF;
        margin-left: 50px;
        float: left;
        /*div内文字居中*/
        display:flex;
        justify-content:center;
        align-items:center;
        /*阴影效果*/
        box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.1);
    }
    .pageNumDivUp{
        width: 60px;
        height: 40px;
        border-radius: 20px;
        background-color: #24BCFF;
        margin-left: 50px;
        float: left;
        display:flex;
        justify-content:center;
        align-items:center;
        /*阴影效果*/
        box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.1);
    }
    .pageNumDivDown{
        width: 60px;
        height: 40px;
        border-radius: 20px;
        background-color: #24BCFF;
        margin-left: 50px;
        float: left;
        display:flex;
        justify-content:center;
        align-items:center;
        /*阴影效果*/
        box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.1);
    }
</style>

<script type="text/javascript">
    var editor;
    $(function (){
        var op = {
            initialFrameHeight:400,
            initialFrameWidth:900,
            toolbars:[
                ['fontfamily','|','fontsize',"|","forecolor","|",'paragraph',"|","bold","|","italic","|","indent","|"],
                ['simpleupload',"|",'insertimage',"|","tolowercase","|","touppercase","|","undo","|","redo","|"],
                ['justifyleft',"|","justifyright","|","justifycenter","|","justifyjustify","|","rowspacingtop","|","rowspacingbottom","|"]
            ]
        }
        editor = UE.getEditor("title",op);
    });
</script>
<div class="pc-container">
    <div class="pc-content">
        <!-- [ breadcrumb ] start -->
        <div class="page-header">
            <div class="page-block">
                <div class="row align-items-center">
                    <div class="col-md-12">
                        <div class="page-header-title">
                            <h5 class="m-b-10">查看所有房屋信息</h5>
                        </div>
                        <ul class="breadcrumb">
                            <li class="breadcrumb-item"><a href="/myhouse/mediator/index">首页</a></li>
                            <li class="breadcrumb-item"><a href="javascript: void(0)">ISSUE</a></li>
                            <li class="breadcrumb-item" aria-current="page">管理员回复</li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <!-- [ sample-page ] start -->
            <div class="col-sm-12">
                <div class="card">
                    <div class="card-header">
                        <h5>管理员回复</h5>
                    </div>

                    <div class="card-body" style="height: 900px;">
                        <c:if test="${ empty sessionScope.mediator}">
                            <span style="font-size: 50px; margin-left: 500px;  ">请先登录</span>
                        </c:if>
                        <c:if test="${not empty sessionScope.mediator}">
                            <table border="1px" style="height: 100px; text-align: center;">
                                <tr>
                                    <th style="text-align: center;">我反馈的问题</th>
                                    <th style="text-align: center;">处理情况</th>
                                    <th style="text-align: center;">处理结果</th>
                                    <th></th>
                                </tr>
                                <c:forEach items="${requestScope.feedBackList}" var="feedBack">
                                    <tr>
                                        <td>${feedBack.feedBack}</td>
                                        <td>
                                            <c:if test="${feedBack.dispose == false}">未处理</c:if>
                                            <c:if test="${feedBack.dispose == true}">已处理</c:if>
                                        </td>
                                        <td>
                                                ${feedBack.reply}

                                        </td>
                                        <td><c:if test="${feedBack.dispose == true}">结果不满意？<a href="/myhouse/mediator/contact?id=${sessionScope.mediator.id}" style="color: #24BCFF">重新提交</c:if></a></td>
                                    </tr>
                                </c:forEach>
                            </table>


                            <div id="mydiv">

                                <c:if test="${requestScope.pager.pageNO gt 1}">
                                    <div class="pageNumDivUp" >
                                    <a href="/myhouse/mediator/managerReply?pno=${requestScope.paper.pageNO-1}&&mediatorId=${sessionScope.mediator.id}"><span class="span">上一页</span></a>
                                    </div>
                                </c:if>

                                <c:forEach begin="1" end="${requestScope.pager.pageCount}" var="i">
                                    <c:if test="${requestScope.pager.pageNO == i}">
                                        <div class="pageNumDiv" >
                                        <a href="/myhouse/mediator/managerReply?pno=${i}&&mediatorId=${sessionScope.mediator.id}" style="color: red"><span class="span" >${i}</span></a>
                                        </div>
                                    </c:if>
                                    <c:if test="${requestScope.pager.pageNO ne i}">
                                        <div class="pageNumDiv" >
                                        <a href="/myhouse/mediator/managerReply?pno=${i}&&mediatorId=${sessionScope.mediator.id}" style="color: black"><span class="span" >${i}</span></a>
                                        </div>
                                    </c:if>
                                </c:forEach>
                                <c:if test="${requestScope.pager.pageNO lt requestScope.pager.pageCount}">
                                    <div class="pageNumDivDown" >
                                    <a href="/myhouse/mediator/managerReply?pno=${requestScope.pager.pageNO+1}&&mediatorId=${sessionScope.mediator.id}"><span class="span" >下一页</span></a>
                                    </div>
                                </c:if>
                            </div>
                        </c:if>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Required Js -->
<script src="/myhouse/static/mediator/js/plugins/popper.min.js"></script>
<script src="/myhouse/static/mediator/js/plugins/simplebar.min.js"></script>
<script src="/myhouse/static/mediator/js/plugins/bootstrap.min.js"></script>
<script src="/myhouse/static/mediator/js/config.js"></script>
<script src="/myhouse/static/mediator/js/pcoded.js"></script>

<script src="/myhouse/static/mediator/js/plugins/clipboard.min.js"></script>
<script>
    window.addEventListener('load', (event) => {
        var i_clip = new ClipboardJS('.color-block');
        i_clip.on('success', function (e) {
            var targetElement = e.trigger;
            let icon_badge = document.createElement('span');
            icon_badge.setAttribute('class', 'ic-badge badge bg-success float-end');
            icon_badge.innerHTML = "copied";
            targetElement.append(icon_badge);
            setTimeout(function () {
                targetElement.children[0].remove();
            }, 3000);
        });

        i_clip.on('error', function (e) {
            var targetElement = e.trigger;
            let icon_badge = document.createElement('span');
            icon_badge.setAttribute('class', 'ic-badge badge bg-danger float-end');
            icon_badge.innerHTML = "Error";
            targetElement.append(icon_badge);
            setTimeout(function () {
                targetElement.children[0].remove();
            }, 3000);
        });
    });
</script>
</body>
</html>
